﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Configuration;
/// <summary>
/// Summary description for DatabaseInteractionn
/// </summary>
public class DatabaseInteractionn
{
    public static SqlConnection GetConnection()
    {
        string sqlConnection = ConfigurationManager.ConnectionStrings["dsCustomers"].ToString();
        SqlConnection cnn = null;
        try
        {
            cnn = new SqlConnection(sqlConnection);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            return null;
        }
        
        return cnn;
    }

    public static string SelectProduct = "select * from Products";
    public static string SearchProductID(string text)
    {
        string search = "select * from Products where ProductName like'%" + text + "%'";
        return search;
    }
}